<template>
	<el-main class="nopadding">
		<sc-water-mark ref="wm" :text="waterMarkContent" :subtext="waterMarkSubtext" :showWater="waterMark=='1'" style="height: 100%;">
			<el-image :src="src"></el-image>
		</sc-water-mark>
	</el-main>
</template>

<script>
import config from "@/config"
import sysConfig from "@/config";
export default {
	components:{
	},
	data(){
		return {
			attachId:this.$route.query.attachId,
			netDiskId:this.$route.query.netDiskId,
			isNetDisk:this.$route.query.isNetDisk,
			extName:this.$route.query.extName,
			src: '',//设置文档地址
			waterMarkContent: '',
			waterMarkSubtext: '',
			waterMark: '0',
		}
	},
	methods:{
		rendered(){
			console.log("渲染完成")
		}
	},
	mounted() {
		this.waterMark = this.$TOOL.data.get("WATER_MARK");
		this.waterMarkContent = this.$TOOL.data.get("WATER_MARK_CONTENT");
		this.waterMarkSubtext = this.$TOOL.data.get("WATER_MARK_SUBTEXT");
		if(this.isNetDisk=='true')
		{
			this.src = sysConfig.API_URL+'/get/file/downNetDiskFile?netDiskId=' + this.netDiskId + "&fileName=" + encodeURIComponent(this.attachId)
		}else {
			this.src = sysConfig.API_URL+'/get/file/getFileDown?attachId=' + this.attachId + "&extName=" + this.extName
		}
	}
}
</script>
